package com.chen.project.file_server.service.impl;

import com.chen.project.file_server.dao.FileInfoDAO;
import com.chen.project.file_server.dao.impl.FileInfoDAOImpl;
import com.chen.project.file_server.pojo.FileInfo;
import com.chen.project.file_server.service.FileInfoService;

import java.util.List;

public class FileInfoServiceImpl implements FileInfoService {

    private FileInfoDAO fileInfoDAO = new FileInfoDAOImpl();

    @Override
    public int addOneFileInfo(FileInfo fileInfo) {

        int i = fileInfoDAO.insertOneFileInfo(fileInfo);
        return i;
    }

    @Override
    public FileInfo getOneFileInfoByUuid(String uuid) {
        return fileInfoDAO.selectOneFileInfoByUuid(uuid);
    }

    @Override
    public List<FileInfo> getFileInfoList() {
        List<FileInfo> fileInfos = fileInfoDAO.selectLastTenFileInfo();
        return fileInfos;

    }
}
